package com.hmall.common.config;

import org.springframework.amqp.support.converter.Jackson2JsonMessageConverter;
import org.springframework.amqp.support.converter.MessageConverter;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class MqConfig {
    @Bean
    // 声明RabbitMQ内部调用的消息转换器，以替代默认的Java对象序列化方式
    public MessageConverter messageConverter() {
        return new Jackson2JsonMessageConverter();
    }
}
